#include<stdio.h>
#include<unistd.h>
#include<pthread.h>
/*
This is child thread
thread ret = thread return

 *
 */

void * func(void * arg){
	printf("This is child thread\n");
	sleep(10);
	pthread_exit("thread return");
}

int main(){
	pthread_t tid;
	void *retv;
	pthread_create(&tid, NULL, func, NULL);

	//主线程会在这一行停住，直到子线程执行完才接着往后走
	pthread_join(tid, &retv);
	printf("thread ret = %s\n", (char *)retv);
}
